<div align="center">
<table border="0" cellspacing="0" cellpadding="0" class="tblbg" width="550">
	<tr>
		<td>
		<table border="0" cellspacing="1" width="100%">
			<tr>
				<td class="tbltop">&nbsp;<?=$T['menu'][$url];?>&nbsp;</td>
			</tr>
			<tr>
                  <td width="100%">
                    <table border="0" width="100%" class="content">
                        <?php
				$aliases = str_replace(" ", ", ", $domaindata['aliases']);
				if (!$aliases)
					$aliases = $T['none'];
			?>
                      <tr>
			            <td valign="top" width="10%" nowrap><b><?=$T['Domain Name'];?>:</b>&nbsp;</td>
						<td valign="top" width="100%"><a href="http://<?=$domaindata['host'].".".$domaindata['domain'];?>/" target="_blank"><?=$domaindata['host'].".".$domaindata['domain'];?></a></td>
                      </tr>
                      <tr>
						<td valign="top" width="10%" nowrap><b><?=$T['Hostname Aliases'];?>:</b>&nbsp;</td>
						<td valign="top" width="100%"><?=$aliases;?></td>
                      </tr>
                      <tr>
						<td valign="top" width="10%" nowrap><b><?=$T['IP Address'];?>:</b>&nbsp;</td>
						<td valign="top" width="100%"><?=str_replace('|', '<br>', $domaindata['ip']);?></td>
                      </tr>
                      <tr>
			            <td valign="top" width="10%" nowrap><b><?=$T['Domain Contact'];?>:</b>&nbsp;</td>
						<td valign="top" width="100%"><a href="mailto:<?=$domaindata['email'];?>"><?=$domaindata['email'];?></a></td>
                      </tr>
                      <tr><td><br /></td></tr>
                    </table>

                    <table border="0" width="100%" class="content">
                      <tr>
                        <td align="left" bgcolor="#EBEBEB" nowrap><b>Feature</b></td>
                        <td align="left" bgcolor="#EBEBEB" nowrap><b>Used&nbsp;</b></td>
                        <td align="left" bgcolor="#EBEBEB" nowrap><b>Total</b></td>
                        <td align="left" bgcolor="#EBEBEB" nowrap colspan="2"><b>Used %&nbsp;</b></td>
					</tr>
            <tr>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<a href="<?=$current_url;?>&url=domainset"><?=$T['Hard Disk Usage'];?></a>
                        </td>
                        <td nowrap class="features">
                          &nbsp;<?=$domaindata['hd_used'];?> <?=$T['mb'];?></td>
                        <td nowrap class="features">
                          &nbsp;<?=(($domaindata['hd'] != -1) ? $domaindata['hd']." ".$T['mb'] : $T['Unlim']);?></td>
                        <td nowrap class="features">
                        <? if ($domaindata['hd'] != -1) {
							$tmp=(round($domaindata['hd_used'] / $domaindata['hd'] * 100,2));
							?>
                        	<span class="service<?=(($tmp < 100) ? 'ok' : 'notok');?>">
                    		<?="&nbsp;".$tmp;?>&nbsp;</span>%
                        <? } ?>
                        </td>
                        <td class="features"><div class="bargraphContainer"><div class='bargraph' style="width: <?=round($tmp);?>%;"></div></div></td>
			</tr>
			<tr>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<a href="<?=$current_url;?>&url=useradmin"><?=$T['Users'];?></a>
                        </td>
                        <td nowrap class="features">
                          &nbsp;<?php $tmp = fetchdata("users","total",$domaindata['id']); $tmp = intval($tmp['users']); echo $tmp; ?></td>
                        <td nowrap class="features">
                          &nbsp;<?=(($domaindata['users'] != -1) ? $domaindata['users'] : $T['Unlim']);?></td>
                        <td nowrap class="features">
                        <? if ($domaindata['users'] != -1) {
							$tmp=(round($tmp / $domaindata['users'] * 100,2));
							?>
                        	<span class="service<?=(($tmp < 100) ? 'ok' : 'notok');?>">
                    		<?="&nbsp;".$tmp;?>&nbsp;</span>%
                        <? } ?>
                        </td>
                        <td class="features"><div class="bargraphContainer"><div class='bargraph' style="width: <?=round($tmp);?>%;"></div></div></td>
			</tr>
			<tr>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<a href="<?=$current_url;?>&url=dbadmin"><?=$T['Databases'];?></a>
                        </td>
			<?php
			$tmp = fetchdata("db","total",$domaindata['id']);
			$tmp = intval($tmp['db']);
			if ($domaindata['db'] != 0) { ?>
                        <td nowrap class="features">
                          &nbsp;<?php echo $tmp; ?></td>
                        <td nowrap class="features">
                          &nbsp;<?=(($domaindata['db'] != -1) ? $domaindata['db'] : $T['Unlim']);?></td>
                        <td nowrap class="features">
                        <? switch($domaindata['db']) {
				case -1:
					break;
				default:
					$tmp=(round($tmp / $domaindata['db'] * 100,2));?>
	                        	<span class="service<?=(($tmp < 100) ? 'ok' : 'notok');?>">
        	            		<?="&nbsp;".$tmp;?>&nbsp;</span>%
                        		<? break;
				} ?>
                        <? } else { ?>
                        <td nowrap class="features" colspan="3">
                          &nbsp;<?=$T['none'];?>
                        <?php } ?>
                        </td>
                        <td class="features"><div class="bargraphContainer"><div class='bargraph' style="width: <?=round($tmp);?>%;"></div></div></td>
			</tr>
            <tr>
                        <td nowrap class="features">
                        &nbsp;&nbsp;<a href="<?=$current_url;?>&url=subdomain"><?=$T['Subdomains'];?></a>
                        </td>
                        <?php $tmp = fetchdata("subdomains","total",$domaindata['id']); $tmp = intval($tmp['subdomains']);;
                           if ($domaindata['subdomains'] != 0) { ?>
                        <td nowrap class="features">
                          &nbsp;<?=$tmp; ?></td>
                        <td nowrap class="features">
                          &nbsp;<?=(($domaindata['subdomains'] != -1) ? $domaindata['subdomains'] : $T['Unlim']); ?>
                        </td>
                        <td nowrap class="features">
                        <? if ($domaindata['subdomains'] != -1) {
							$tmp=(round($tmp / $domaindata['subdomains'] * 100,2));
							?>
                        	<span class="service<?=(($tmp < 100) ? 'ok' : 'notok');?>">
                    		<?="&nbsp;".$tmp;?>&nbsp;</span>%
                        <? } ?>
                        <?php } else { ?>
                        <td nowrap class="features" colspan="3">
                          &nbsp;<?=$T['none'];?>
                        <?php } ?>
                        </td>
                        <td class="features"><div class="bargraphContainer"><div class='bargraph' style="width: <?=round($tmp);?>%;"></div></div></td>
			</tr>
			<tr>
                        <td nowrap class="features">
                        &nbsp;&nbsp;<a href="<?=$current_url;?>&url=domainpointer"><?=$T['Dom Pointers'];?></a>
                        </td>
                        <?php $tmp = fetchdata("pointers","total",$domaindata['id']); $tmp = intval($tmp['pointers']);;
                           if ($domaindata['pointers'] != 0) { ?>
                        <td nowrap class="features">
                          &nbsp;<?=$tmp; ?></td>
                        <td nowrap class="features">
                          &nbsp;<?=(($domaindata['pointers'] != -1) ? $domaindata['pointers'] : $T['Unlim']); ?>
                        </td>
                        <td nowrap class="features">
                        <? if ($domaindata['pointers'] != -1) {
							$tmp=(round($tmp / $domaindata['pointers'] * 100,2));
							?>
                        	<span class="service<?=(($tmp < 100) ? 'ok' : 'notok');?>">
                    		<?="&nbsp;".$tmp;?>&nbsp;</span>%
                        <? } ?>
                        <?php } else { ?>
                        <td nowrap class="features" colspan="3">
                          &nbsp;<?=$T['none'];?>
                        <?php } ?>
                        </td>
                        <td class="features"><div class="bargraphContainer"><div class='bargraph' style="width: <?=round($tmp);?>%;"></div></div></td>
			</tr>
			<?
			$ret = Array('domaindata' => $domaindata, 'entries' => Array());
			call_hook('web:domain:domaininfo:table', $ret);
			if (is_array($ret['entries'])) {
			foreach($ret['entries'] as $item) {
			?>
			<tr>
                        <td nowrap class="features">
                        &nbsp;&nbsp;<a href="<?=$current_url;?>&url=<?=$item['url'];?>"><?=$item['label'];?></a>
                        </td>
                        <?php $tmp = fetchdata($item['fieldname'],"total",$domaindata['id']); $tmp = intval($tmp[$item['fieldname']]);;
                           if ($domaindata[$item['fieldname']] != 0) { ?>
                        <td nowrap class="features">
                          &nbsp;<?=$tmp; ?></td>
                        <td nowrap class="features">
                          &nbsp;<?=(($domaindata[$item['fieldname']] != -1) ? $domaindata[$item['fieldname']] : $T['Unlim']); ?>
                        </td>
                        <td nowrap class="features">
                        <? if ($domaindata[$item['fieldname']] != -1) {
							$tmp=(round($tmp / $domaindata[$item['fieldname']] * 100,2));
							?>
                        	<span class="service<?=(($tmp < 100) ? 'ok' : 'notok');?>">
                    		<?="&nbsp;".$tmp;?>&nbsp;</span>%
                        <? } ?>
                        <?php } else { ?>
                        <td nowrap class="features" colspan="3">
                          &nbsp;<i><?=$T['none'];?></i>
                        <?php } ?>
                        </td>
                        <td class="features"><div class="bargraphContainer"><div class='bargraph' style="width: <?=round($tmp);?>%;"></div></div></td>
			</tr>
			<?
			}
			}
			?>
					<tr><td><br /></td></tr>
                    </table>
                    <table border="0" width="100%" class="content">
			<tr>
                        <td align="left" bgcolor="#EBEBEB" nowrap colspan="2"><a href="<?=$current_url;?>&url=domainset"><b><?=$T['Server Side Options'];?></b></a></td>
                      </tr>
<?php
				global $cfg;
				if (strstr($cfg['sslang'],","))
					$sslang = explode(",",$cfg['sslang']);
				else
					$sslang[0] = $cfg['sslang'];

				//$j = 0;
				//unset($tmpdata);
				//while ($sslang[$j]) {
				foreach($sslang as $ss) {
					$ss = trim($ss);
					if (!$domaindata['serverside'][$ss])
						$domaindata['serverside'][$ss] = "na";

					if (($domaindata['serverside'][$ss] != "na") && ($userdata['level'] <= 3) ) {
?>
					<tr>
                        <td  nowrap class="features">&nbsp;<?=$T['ss'][$ss];?>&nbsp;</td>
                        <td  nowrap class="features">&nbsp;<?=$T[$domaindata['serverside'][$ss]];?>&nbsp;</td>
                    </tr>
<?php
                	} else {
?>
					<tr>
                        <td  nowrap class="features">&nbsp;<?=$T['ss'][$ss];?>&nbsp;</td>
                        <td  nowrap class="features">&nbsp;<?=$T['na'];?>&nbsp;</td>
                    </tr>
<?php
					}
				}
?>
					</tr>
					<tr><td><br /></td></tr>
				</table>
<?
if ($domaindata['serverside']['webalizer'] == 'on') {
?>
                    <table border="0" width="100%" class="content">
                      <tr>
                        <td align="left" bgcolor="#EBEBEB" nowrap colspan="2"><b><?=$T['Statistics Summary'];?></b></td>
                      </tr>
                      <tr>
                        <td align="center" nowrap class="features">
                          <a href="<?=$current_url;?>&url=domainstat"><img border="0" src="/domain/includestat.php?domain=<?=$domaindata['domain'];?>&host=<?=$domaindata['host'];?>&webalizerfile=usage.png" alt="<?=$domaindata['domain'];?> Usage"/></a>
				</td>
			</tr>
                                <?php  // show subdomains summary if applicable
                                $dbp1 = mysql_query("SELECT host, domain FROM domains WHERE type != 'pointer' AND owner = ".$domaindata['id']);
                                // show summry only if there are sub/pointers to list
                                if (mysql_num_rows($dbp1)) {
                                //show sub/pointer transfer
	                                while ($tmp = mysql_fetch_array($dbp1)) { ?>
                      <tr>
                        <td nowrap class="features" align="center">
                          <a href="<?=$current_url;?>&url=domainstat&host=<?=$tmp['host'];?>"><img border="0" src="/domain/includestat.php?domain=<?=$tmp['domain'];?>&host=<?=$tmp['host'];?>&webalizerfile=usage.png" alt="<?=$tmp['host'];?>.<?=$tmp['domain'];?> Usage"/></a>
                        </td>
                      </tr>
<?php					}
                                }
?>
		</table>
<? } ?>
                  </td>
                </tr>
              </table>
		</td>
	</tr>
</table>
</div>
